<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>  
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
    <base href="<%=basePath%>">
    <title>优标检测网</title>
    <!-- 浏览器上显示title 图标 icon图标 -->
	<link type="image/x-icon" rel="icon" href="<%=basePath %>resource/img/minilogo.png">

	<!-- 如果想让图标出现在收藏夹中，就：  -->
	<link type="image/x-icon" rel="shortcut icon" href="<%=basePath %>resource/img/minilogo.png">
	<link type="image/x-icon" rel="bookmark" href="<%=basePath %>resource/img/minilogo.png">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="优标">
	<meta http-equiv="description" content="优标">
    <link href="<%=basePath %>portal/css/page.css" type="text/css" rel="stylesheet">
    <link href="<%=basePath %>portal/css/main.css" type="text/css" rel="stylesheet">
    <title>个人中心</title>
</head>
<body>

<%@include file="p_head.jsp"%>

<div class="NCContent">
    <div class="NCNewsHead">
        <div class="MainPage">
            <div class="NCMain">
                <h2 class="NCHeadWord">个人中心 / Personal Center </h2>
            </div>
        </div>
    </div>
    <div class="NCNewsList">
        <div class="MainPage">
            <div class="NCMain">
                <div class="NCNewsListContent">
                    <div class="PCContentHead1"></div>
                    <div class="PCContentBody1">
                        <%@include file="p_left.jsp"%>
                        <div class="PCContentMain">
                            <div class="PCPerInfoContent PCPerInfoMarginfix">
                            <form action="<%=basePath%>account_editPerson.action" method="post" id="editPersonForm" enctype="multipart/form-data">
								<input type="hidden" name="accountId" value="${accountId}"/>
								<input type="hidden" name="accountType" value="${accountType}"/>
								<input type="hidden" name="password" value="${password}"/>
                                <div class="PCPerInfoBox">
                                    <span class="PCPerInfoTitle">头像：</span>
                                    <span class="PCPerInfo"><!--上传后的图片显示在这里--><div style="display:;" class="PCPerInfoUserIconImg">
                                    <img id="imgPhoto" class="PCPerInfoUserIcon" src="<c:if test="${not empty headImgURLFileName}"><%=basePath %>${headImgURLFileName}</c:if>
                                    	  <c:if test="${empty headImgURLFileName}"><%=basePath %>file/img/morentouxiang.jpg</c:if>"/><br/>
                                    <div id="divPreview"></div>
                                    </div><input type="file" id="headImgURL" name="headImgURL" onchange="PreviewImage(this,'imgPhoto','divPreview');"/>
									<span style="display:none;" class="RegMsg2">上传的头像不是图片类型</span></span></span>
                                </div>
                                <div class="PCPerInfoBox">
                                    <span class="PCPerInfoTitle">用户名：</span>
                                    <span class="PCPerInfo"><input id="nickName" name="nickName" type="text" value="${nickName}"/>
                                    <span style="display:none;" class="RegMsg2">*用户名不能为空</span></span>
                                </div>
                                <div class="PCPerInfoBox">
                                    <span class="PCPerInfoTitle">性别：</span>
                                    <span class="PCPerInfo"><select id="sex" name="sex" style="width:205px">
										<option value="1">男</option>
										<option value="0" <c:if test="${sex==0}">selected</c:if>>女</option>
									</select></span>
                                </div>
                                <div class="PCPerInfoBox">
                                    <span class="PCPerInfoTitle">生日：</span>
                                    <span class="PCPerInfo"><input id="birthday" name="birthday" value='<fmt:formatDate value="${birthday}" 
                                    pattern="yyyy-MM-dd"/>' class="Wdate" id="search_start" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" style="width:205px"></input></span>
                                </div>
                                <div class="PCPerInfoBox">
                                    <span class="PCPerInfoTitle">手机号：</span>
                                    <span class="PCPerInfo"><input readonly="readonly" id="phone" name="phone" type="text" value="${phone}"/></span>
                                </div>
                                <div class="PCPerInfoBox">
                                    <span class="PCPerInfoTitle">单位名称：</span>
                                    <span class="PCPerInfo"><input id="compName" name="compName" type="text" value="${compName}"/>
                                    <span style="display:none;" class="RegMsg2">单位名称不存在</span></span></span>
                                </div>
                                <div class="PCPerInfoBox">
                                    <span class="PCPerInfoTitle">地址：</span>
                                    <span class="PCPerInfo"><input id="address" name="address" type="text" value="${address}"/></span>
                                </div>
                                <div class="PCPerInfoBox">
                                    <span class="PCPerInfoTitle">邮箱：</span>
                                    <span class="PCPerInfo"><input id="email" name="email" type="text" value="${email}"/>
                                    <span style="display:none;" class="RegMsg2">邮箱格式不正确</span></span>
                                </div>
							</form>
                            </div>
                            <div style="clear:both"></div>
                        </div>
                        <div class="QCListBottom">
                            <span class="BtnCss QCCSubmitBtn PCPerInfoBtn">完成编辑</span>
                        </div>
                    </div>
                    <div class="PCContentFoot1"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<%@include file="p_foot.jsp"%>

</body>
<script src="<%=basePath %>portal/js/res/jquery-1.4.2.min.js"></script>
<script src="<%=basePath %>portal/js/res/jquery.myPagination.js"></script>
<script src="<%=basePath %>portal/js/res/responsiveslides.min.js"></script>
<script src="<%=basePath %>portal/js/page/base.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.min.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>
<script src="<%=basePath %>portal/js/res/My97DatePicker/WdatePicker.js"></script>
<script src="<%=basePath %>portal/js/page/personalinfo.js"></script>
<script>
$('#editPersonForm').form({
    onSubmit: function() {
        return $(this).form('validate');
    },
    success: function(data) {
		var mydata = JSON.parse(data);
		switch(mydata.result) {
		case 0:
			window.location="<%=basePath%>account_showAccount.action";
			break;
		case 1:
			$("#nickName").parent().find(".RegMsg2").html(mydata.msg).show();
			break;
		case 2:
			$("#email").parent().find(".RegMsg2").html(mydata.msg).show();
			break;
		case 3:
		case 4:
			$("#file").parent().find(".RegMsg2").html(mydata.msg).show();
			break;
		case 5:
			$("#compName").parent().find(".RegMsg2").html(mydata.msg).show();
			break;
		case 12:
			$("#email").parent().find(".RegMsg2").html(mydata.msg).show();
			break;
		}
	}
});
$(".QCCSubmitBtn").click(function(){
	var flag = true;
    flag = checknickName();
    if ($("#email").val() != "")
    	flag = checkemail();
    
	if (flag)
		$('#editPersonForm').submit();
});
</script>
</html>